
    <div class="row" style="padding: 10px 20px 0px;">
        <nodestr></nodestr>
    </div>
    <form class="form-horizontal" name="dstForm"  role="form" novalidate>

    <div class="" style="width: 70%;margin-left: 10%;margin-bottom: 15px;">
            <div class="row">
                <div class="col-sm-10">
                    <label class="col-sm-2  control-label">
                        作业名称 <span style="color: red">*</span>
                    </label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" name="s_name" ng-model="dstDate.name" required />

                    </div>
                </div>
            </div>
    </div>
    <div class="panel panel-primary" style="width: 80%;margin-left: 10%;">
        <div class="panel-body">
            <div class="form-horizontal">

                    <div class="row">
                        <div class="col-sm-12 form-group">
                            <label class="col-sm-5" style="font-size: 16px;padding-top: 10px;">
                                <span class="glyphicon glyphicon-hdd" style="padding: 0 3px;"></span>源文件
                                <span style="margin-left:15px;font-weight: normal;font-size: 12px">注意：本地文件上传会用同名文件覆盖危险</span>
                            </label>

                            <div class="col-sm-7">
                                <button class="btn btn-primary" ng-click="distribute.choiceShareFiles()" >
                                    <span class="glyphicon glyphicon-cloud" style="padding: 0 3px;"></span>选择共享文件
                                </button>
                                <button class="btn btn-primary" ng-click="distribute.choiceSourceFile()" >
                                    <span class="glyphicon glyphicon-oil" style="padding: 0 3px;"></span>选择源服务器文件
                                </button>
                                <button class="btn btn-primary" ng-click="distribute.choiceVariable()" >
                                    <span class="glyphicon glyphicon-oil" style="padding: 0 3px;"></span>选择构建文件
                                </button>
                                <div id="upresult" class="form-inline" style="font-weight: bold">
                                    <span>{{distribute.up_re}}</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row row col-sm-11">
                        <div class="col-sm-11 " style="margin-left: 1%;">
                                <table ng-table="choice.shareResult" class="table table-hover" style="border: 1px solid #ddd;" >
                                    <thead >
                                        <tr ng-if="!varShow">
                                            <th style="text-align: left;width: 27%">文件列表</th>
                                            <th style="text-align: left;width: 29%">服务器地址</th>
                                            <th ng-hide="true" style="text-align: left;width: 25%">执行账户</th>
                                        </tr>
                                        <tr ng-if="varShow">
                                            <th style="text-align: left;width: 27%">环境</th>
                                            <th style="text-align: left;width: 29%">版本</th>
                                            <th ng-hide="true" style="text-align: left;width: 25%">执行账户</th>
                                        </tr>
                                    </thead>
                                    <tbody id="srcbody">
                                        <tr ng-repeat="ss in shareResult">
                                            <td>{{ss.name}}</td>
                                            <td>默认空</td>
                                            <td ng-hide="true">
                                                <select class="form-control " style="font-size: 18px" disabled="disabled" ng-model="dstUser" ng-options="s.username for s in allProUsers" ></select></td>
                                        </tr>
                                        <tr ng-show = varShow>
                                            <td>{{varData.ci}}</td>
                                            <td>{{varData.version}}</td>
                                            <td ng-hide="true"><select class="form-control " style="font-size: 18px" disabled="disabled" ng-model="dstUser" ng-options="s.username as s.username for s in allProUsers" ></select></td>
                                        </tr>
                                        <tr ng-show="srcShow">
                                            <td><textarea ng-model="copySrcdata.sp" style="min-height: 40px;min-width: 200px" placeholder="输入文件地址" required></textarea></td>
                                            <td>
                                                <div>
                                                    <div>
                                                        <span>{{srouceServerResult}}</span>
                                                    </div>
                                                    <div>
                                                        <button ng-hide="true" id="click123" class="btn btn-default btn-xs" style="margin-left: 73%;" ng-click="distribute.choiceSourceServer($event)" required >添加</button>
                                                        <span style="color: red" ng-show="srcServerShow">必选源服务器</span>
                                                    </div>
                                                </div>
                                            </td>
                                            <td ng-hide="true" >
                                                <select class="form-control " style="font-size: 15px" disabled="disabled" ng-model="dstUser" ng-options="s.username for s in allProUsers"></select>
                                            </td>

                                        </tr>
                                    </tbody>
                                </table>
                        </div>
                    </div>

            </div>
        </div>
    </div>

    <div class="panel panel-primary" style="width: 80%;margin-left: 10%;">
        <div class="panel-body">

            <div class="form-horizontal">

                    <div class="row">
                        <div class="col-sm-12 form-group">
                            <label class="col-sm-6 " style="font-size: 16px;padding-top: 10px;">
                                <span class="glyphicon glyphicon-folder-open" style="padding: 0 3px;"></span>目标文件
                            </label>

                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">目标路径 <span style="color: red">*</span></label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" ng-model="dstDate.dp" name="dstpath" placeholder="请填写分发路径"  required />
                            </div>
                            <span class="glyphicon glyphicon-question-sign" data-toggle="tooltip" data-placement="right" uib-tooltip="目标路径以'/'结尾代表一个目录，不以‘/’结尾表示一个文件。如：/tmp/表示将文件保存到此目录下，/tmp/test.txt表示将文件保存到此目录下，文件名为test.txt" aria-hidden="true" style="padding-top: 11px;font-size: larger;"></span>
                        </div>
                    </div>

                    <div class="row" ng-show="scp_dir">
                        <div class="col-sm-10 form-group">
                            <label class="col-md-3 control-label" >同步delete</label>
                            <div class="col-md-2 admin-form">
                                <label class="switch switch-system mt5">
                                    <input type="checkbox" id="scp_delete" ng-model="dstDate.scp_delete">
                                    <label for="scp_delete" data-on="ON" data-off="OFF"></label>
                                </label>
                            </div>
                            <span class="glyphicon glyphicon-question-sign" data-toggle="tooltip" data-placement="right" uib-tooltip="开启后，同步文件夹时删除DEST中SRC没有的文件" aria-hidden="true" style="padding-top: 11px;font-size: larger;"></span>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">执行账户 <span style="color: red">*</span></label>
                            <div class="col-sm-7">
                                <select  class="form-control " style="font-size: 18px;padding: 0 12px;"  ng-model="dstUser" ng-options="s.username for s in allProUsers" required>
                                </select>
                                <span style="color: red" ng-show="userShow">必选执行用户</span>
                            </div>
                            <button class="btn btn-primary col-sm-1" uib-tooltip="添加" ng-click="distribute.addProUser()"><i class="fa fa-plus"></i></button>

                        </div>

                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group" style="margin-top: -23px;">
                            <label class="col-sm-3 control-label"></span></label>
                            <div class="col-sm-7">
                                <dataerror ng-hide="dataready" errmsg={{dataerror}}></dataerror>

                            </div>

                        </div>
                    </div>

                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">目标机器 <span style="color: red">*</span></label>
                            <div class="col-sm-9">
                                <button class="btn btn-primary" ng-click="distribute.choiceServer()" required >选择服务器</button>
                                <span style="color: red" ng-show="dstServerShow">必须目标服务器</span>
                                <table ng-table="distribute.choiceResult" class="table table-hover" ng-show="choiceShow" style="margin-top: 10px;border: 1px solid #ddd;" >
                                    <thead >
                                        <tr>
                                            <th style="text-align: left;">编号</th>
                                            <th style="text-align: left;">名称</th>
                                            <th style="text-align: left;">类型</th>
                                            <th style="text-align: left;">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="ss in choiceResult">
                                            <td>{{$index + 1}}</td>
                                            <td ng-if="dstDate.dst_type =='group'"  >{{ss.name}}</td>
                                            <td ng-if="dstDate.dst_type =='builtin'">{{ss}}</td>
                                            <td>{{choiceType}}</td>
                                            <td>
                                                <button ng-if="dstDate.dst_type =='group'"  ng-click="distribute.delChoice($index, ss.name)">删除</button>
                                                <button ng-if="dstDate.dst_type =='builtin'" ng-click="distribute.delChoice($index, ss)">删除</button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">文件归属者 &nbsp;</label>
                            <div class="col-sm-7">
                                <select  class="form-control " style="font-size: 18px;padding: 0 12px;"  ng-model="fileChown" ng-options="s.username for s in allProUsers" required>
                                </select>
                                <span style="color: red" ng-show="chownShow">必选文件所有者</span>

                            </div>
                            <button class="btn btn-primary col-sm-1" uib-tooltip="添加" ng-click="distribute.addProUser()"><i class="fa fa-plus"></i></button>

                        </div>

                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">文件权限 &nbsp;</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" ng-model="dstDate.chmod" name="dstchmod" required />
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">超时时间 <span style="color: red">*</span></label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" ng-model="dstDate.timeout" name="timeout" required />

                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">生效环境 <span style="color: red">*</span></label>
                            <div class="col-sm-9">
                                <div class="admin-form">
                                    <div class="option-group field" >
                                        <label class="option option-primary" ng-model="unClickDeployenv">
                                            <input type="radio" name="unClickDeployenv" ng-model="distribute.postdata.deployenv" value="always">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>总是执行
                                        </label>
                                        <label class="option option-primary">
                                            <input type="radio" name="unClickDeployenv" ng-model="distribute.postdata.deployenv" value="test">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>测试环境
                                        </label>
                                        <label class="option option-primary">
                                            <input type="radio" name="unClickDeployenv" ng-model="distribute.postdata.deployenv" value="online">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>线上环境
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">生效动作 <span style="color: red">*</span></label>
                            <div class="col-sm-9">
                                <div class="admin-form">
                                    <div class="option-group field" >
                                        <label class="option option-primary" ng-model="unClickAction">
                                            <input type="radio" name="unClickAction" ng-model="distribute.postdata.action" value="always">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>总是执行
                                        </label>
                                        <label class="option option-primary">
                                            <input type="radio" name="unClickAction" ng-model="distribute.postdata.action" value="deploy">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>仅发布时执行
                                        </label>
                                        <label class="option option-primary">
                                            <input type="radio" name="unClickAction" ng-model="distribute.postdata.action" value="rollback">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>仅回滚时执行
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-10 form-group">
                            <label class="col-sm-3 control-label">分批 <span style="color: red">*</span></label>
                            <div class="col-sm-9">
                                <div class="admin-form">
                                    <div class="option-group field" >
                                        <label class="option option-primary" ng-model="unClickBatches">
                                            <input type="radio" name="unClickBatches" ng-model="distribute.postdata.batches" value="always">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>总是执行
                                        </label>
                                        <label class="option option-primary">
                                            <input type="radio" name="unClickBatches" ng-model="distribute.postdata.batches" value="firsttime">
                                            <span class="radio" style="padding-top: 0;min-height: 0"></span>仅第一个分组
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-3 form-group" style="margin-left: 40%;">
                            <button class="btn btn-success" ng-disabled="" ng-click="distribute.postData()">开始执行</button>
                        </div>
                    </div>

            </div>

        </div>
    </div>
    </form>
